package com.ruoyi.market.http;

import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpUtil;

public class IpUtil {

    public static void getIpResult(String reqIp){


    }


    /**
     * https://whois.pconline.com.cn/ipJson.jsp?ip=101.227.131.220&json=true
     *
     * 太平洋
     * eg:https://whois.pconline.com.cn/ipJson.jsp?ip=111.26.191.94&json=true
     * 使用教程：
     * http://whois.pconline.com.cn/#tabs-2
     */
    private static void aasdf(String reqIp){

        try {
            String queryUrl = "https://whois.pconline.com.cn/ipJson.jsp?ip={}&json=true";
            queryUrl = StrUtil.format(queryUrl, reqIp);

            String result = HttpUtil.get(queryUrl);
            System.out.println(result);
        }catch (Exception exception){

        }
    }

    public static void main(String[] args) {
        String reqIp = "183.159.181.104";

        aasdf(reqIp);
    }
}
